package com.yjz.tkmapper.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yjz.tkmapper.mapper.SysPermissionMapper;
import com.yjz.tkmapper.model.SysRolePermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {
    @Autowired
    private SysPermissionMapper  sysPermissionMapper;
    @GetMapping(value = "/test")
    private  String testTkMapper() throws JsonProcessingException {
        List<SysRolePermission> list= sysPermissionMapper.selectAll();
        return new ObjectMapper().writeValueAsString(list);
    }

}
